package both.map;

import both.map.mapModel.*;

public enum LayerType {
	TERRAIN(TerrainCell.class),
	VISIBILITY(VisibilityCell.class),
	TOKEN(TokenCell.class);
	
	// The class used as contents for cells of this layer type
	private Class<?> contentClass;
	
	/**
	 * Constructor for LayerType
	 * @param contentClass the class used as contents for cells belonging to
	 * a layer of this type
	 */
	LayerType(Class<?> contentClass)
	{
		this.contentClass = contentClass;
	}
	
	/**
	 * get the class used as contents ofr cells belonging to this type of layer
	 * @return the class 
	 */
	public Class<?> getContentClass()
	{
		return contentClass;
	}
	
	/**
	 * test whether a given class matches this layer type's contentClass
	 * @param c the class to be tested against this layer
	 * @return true if the classes match
	 */
	public boolean contentClassMatch(Class<?> c)
	{
		return c == contentClass;
	}
	
}
